From: Marco Trevisan (TreviƱo) Date: Fri, 18 Jun 2021 17:28:55 +0000 (+0200) Subject: ControlsManagerLayout: Use the workarea size to compute the available height X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~574^2^2~199 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f164e086880860a126fde6b6bfa267d8ecbab414;p=gnome-shell.git ControlsManagerLayout: Use the workarea size to compute the available height To compute the available height for the layout we're currently using the panel position, while this works for the current and default setup, the shell may be configured to use a different workarea, so we should rely on it to compute the available space, instead of a specific widget. So get the current monitor index for the current view and use its coordinates instead. Part-of: --- diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js index c15316169..df098ace9 100644 --- a/js/ui/overviewControls.js +++ b/js/ui/overviewControls.js @@ -131,11 +131,10 @@ class ControlsManagerLayout extends Clutter.BoxLayout { const { spacing } = this; - let startY = 0; - if (Main.layoutManager.panelBox.y === Main.layoutManager.primaryMonitor.y) { - startY = Main.layoutManager.panelBox.height; - box.y1 += startY; - } + const monitor = Main.layoutManager.findMonitorForActor(this._container); + const workArea = Main.layoutManager.getWorkAreaForMonitor(monitor.index); + const startY = workArea.y - monitor.y; + box.y1 += startY; const [width, height] = box.get_size(); let availableHeight = height;